/*
* Copyright (C) 2021 ~ 2022 Uniontech Technology Co., Ltd.
*
* Author:      zhangbingyi <zhangbingyi@uniontech.com>
*
* Maintainer:  zhangbingyi <zhangbingyi@uniontech.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "common/usbmanagercomm.h"
#include "common/hpolicykithelper.h"

#include <QObject>

class USBPolicyKitHelper : public HPolicyKitHelper
{
    Q_OBJECT
public:
    explicit USBPolicyKitHelper();
    ~USBPolicyKitHelper();

Q_SIGNALS:
    // 通知去改变usb限制模式
    void notifyChangeLimitationMode(int limitMode);
    // 通知去添加到白名单
    void notifyAddUsbConnectionWhiteLst(const USBConnectionInfo &info);
    void notifyChangeDevPerm(const USBConnectionInfo &info);
    // 通知去清除usb连接记录
    void notifyClearUsbConnectionLog();
    // 通知显示导入白名单文件选择器
    void notifyShowImportWhitelistDlg();
    // 权限校验完成
    void checkAuthorizationFinished();

public Q_SLOTS:

    // 确认选择usb限制模式
    void confirmSelectLimitationMode(int limitMode);
    // 确认添加到白名单
    void confirmAddUsbConnectionWhiteLst(const USBConnectionInfo &info);
    void authorizeChangeDevPerm(const USBConnectionInfo &info);
    // 确认是否清除usb连接记录
    void confirmClearUsbConnectionLog();

    // 确认导入白名单 -- 白名单页面
    void confirmImportWhitelist();
};
